package cn.wolfcode.ssm.service.impl;

import cn.wolfcode.ssm.domain.Business;
import cn.wolfcode.ssm.mapper.BusinessMapper;
import cn.wolfcode.ssm.mapper.BusinessReportMapper;
import cn.wolfcode.ssm.qo.QueryObject;
import cn.wolfcode.ssm.service.IBusinessReportService;
import cn.wolfcode.ssm.service.IBusinessService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class BusinessReportServiceImpl implements IBusinessReportService {

    @Autowired
    private BusinessReportMapper businessReportMapper;

    @Override
    public PageInfo<HashMap> query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize()); //对下一句sql进行自动分页
        List<HashMap> hashMaps = businessReportMapper.selectByGroup(qo);//里面不需要自己写limit
        return new PageInfo<HashMap>(hashMaps);
    }

}
